<?php

namespace app\model\v1\recruit;

use crmeb\traits\ModelTrait;
use think\Model;

class RecruitResume extends Model
{

    use ModelTrait;

    protected $updateTime = false;
    protected $createTime = false;

    protected $hidden = [
    //    'create_time','update_time','delete_time'
    ];



    public function resumesubmit()
    {
        return $this->hasOne(RecruitResumeSubmit::class,'resume_id','id');
    }






    public static function getResumeDetailById($id = "")
    {
        if(empty($id)) return [];

        $detail = self::field("*")
            ->with([
                'resumesubmit' => function ($query) {
                    $query->field("*");
                }
            ])
            ->where("id", $id)
            ->find() ?? [];
        if(!empty($detail)) $detail = $detail->toArray();

        return $detail;
    }





}